<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php 
include("../inc/global.inc");
if($_POST[act]){
   if($_SESSION['chkCode']==$_POST['c_code']){
        $sql="select id,m_email,m_name,m_user,m_psw from member where m_user='$_POST[member_id]'";
        $rs=@mysql_query($sql);
        $row=@mysql_fetch_array($rs);
           if($row['id']){
               if($row[m_email]==$_POST[email])
               {
                
				//start sent email
		        
				
					 $content=iconv("utf-8","gb2312","<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd'>
<HTML xmlns='http://www.w3.org/1999/xhtml'>
<HEAD>
<TITLE>邮件来自三帝贸易网</TITLE>
<META http-equiv=Content-Type content='text/html; charset=gb2312'>
<style type='text/css'>
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	background-color: #FFFFFF;
}
a:link {
	color: #003399;
	text-decoration: underline;
}
a:hover {
	color: #FF6600;
	text-decoration: underline;
}
a:active {
	color: #003399;
	text-decoration: underline;
}
a:visited {
	color: #003399;
	text-decoration: underline;
}



#mail {
	padding: 0px;
	width: 622px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #ECE9D8;
	border-left-color: #ECE9D8;
}
#mail .info .to {
	line-height: 22px;
}

#mail .info .title {
	font-family: Arial;
	font-size: 19px;
	padding: 5px;
	background-color: #EBEBEB;
}

#mail .logo {
	float: left;
	padding-top: 13px;
}
#mail .headbg {
	float: right;
}
#mail .info {
	padding: 10px;
}
#mail .info .note {
	background-color: #ECF3FB;
	padding: 5px;
	line-height: 18px;
}

#mail .foot {
	background-color: #7EB1DA;
	padding: 6px;
	text-align: right;
}

.onl {
	clear: both;
}
-->
</style>
</HEAD>
<BODY>
<div id='mail'>
<div class='logo'><img src='http://www.sandib2b.cn/images/logo.gif' width='388' height='58'></div>
<div class='headbg'><img src='http://www.sandib2b.cn/images/headbg.gif' width='220' height='75'></div>
<div class='onl'></div>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='42' align='right' valign='bottom' background='http://www.sandib2b.cn/images/webbg.gif'><img src='http://www.sandib2b.cn/images/messbg.gif' width='257' height='28'></td>
    </tr>
</table>
<div class='info'>
  <table cellspacing='0' cellpadding='0' width='100%' align='center' border='0'>
    <tbody>
      <tr>
        <td width='593' height='300' valign='top'><div><strong>您好,"."$row[m_name]"."</strong>
                <div class='to'>会员账号:"."$row[m_user]"."<br>
                  安全码:$row[m_psw]<br>
                  设置新密码:<a href='http://www.sandib2b.cn/join/reset_password.php'>http://www.sandib2b.cn/join/reset_password.php</a>
				  <br>
				  <br>
                  <br>
				  <br>
				  <br>
                  <A href='http://www.sandib2b.cn/' target='_blank'>http://www.sandib2b.cn</A>
				  <BR>
                  <br>
				  警告：系统邮件请勿回复！
                </div>
          </div></td>
      </tr>
    </tbody>
  </table>
</div>
<div class='foot'>国内专业网上商品贸易平台<font color='#CC0000'>三帝贸易网</font></div>
</div>
</BODY>
</HTML>");
					 
					 
					 //$m=";taohaij@163.com";
                   
				   
					 sendmail($row['m_email'],"忘记密码三帝贸易网",$content);
                     //sent email end
                     
					 
					 echo "<script>alert('重置密码邮件发送成功');location='/index.php';</script>";
					 }else{
					 
					 echo "<script>alert('您的邮箱错误');location='javascript:history.go(-1)';</script>";
					
					 }
		   }else{
		       
               echo "<script>alert('会员账号错误');location='javascript:history.go(-1)';</script>";
		   }
   }else{
      echo "<script>alert('验证码错误!');location='javascript:history.go(-1)';</script>";
   }
}
?>
<title>忘记密码-三帝贸易网</title>
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/head_2.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="css/join.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="js/join.js" type="text/javascript" charset="gb2312"></script>
</head>
<body>
<?php include("../inc/head_top.php")?>
<div class="top1 topside6">
<div style="float:left;width:388px;"><a href="/"><img src="/images/logo.gif" border="0"/></a></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
<div id="mian" class="topside6 sideyellow1">
<div class="title3 size12">忘记密码<div class="onl"></div>
</div>
<div class="content size14">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="side">
<form name="form" action="" method="post" onSubmit="return checkform()">
      <input type="hidden" name="m_type" value="Free" />
      <tr>
        <td width="230" height="35" align="right">会员账号<font color="#FF0000">*</font>&nbsp;</td>
        <td width="629" height="35"><input name="member_id" type="text" size="20" maxlength="20"></td>
      </tr>
      <tr>
        <td height="35" align="right">注册邮箱<font color="#FF0000">*</font>&nbsp;</td>
        <td height="35"><input name="email" type="text" size="35" maxlength="150"></td>
      </tr>
      <tr>
        <td height="35" align="right">验证吗<font color="#FF0000">*</font>&nbsp; </td>
        <td height="35"><input name="c_code" type="text" id="c_code" size="8" maxlength="6">
        &nbsp;&nbsp;<img src="../inc/chk_num.php" name="img" width="90" height="30" align="absmiddle" id="img">&nbsp;<a href="#" name="can not see" id="test">刷新</a></td>
      </tr>
      <tr>
        <td height="72" colspan="2" align="center">
		<input type="hidden" name="act" value="ok" />
		<input name="submit" type="submit" class="createbut" value="Go" />
		<br>
		<br>
		<br></td>
      </tr>
	  </form>
  </table>
</div>
</div>
<div id="foot" class="footside">
<?php include("../inc/foot.php");?>
</div>
</body>
</html>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){

 if($("member_id").value==""){
    alert("会员账号不能为空");
    $("member_id").focus();
    return false;
 }

var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
　　　　if(!pattern.test($("email").value)){
			alert("邮箱地址不正确.");
			$("email").focus();
			return false;
		}

}

function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="can not see";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
</script>
